package cn.cmm;

import java.util.Random;

/**
 * Created by Lenovo on 2019/1/6.
 */
public class Computer {
   private String name="";

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    //生成随机数的方法
    public int showInfo(){
       int num=(int)(Math.random()*3+1);
        switch (num) {
            case 1:
                System.out.println("电脑出拳:剪刀");
                break;
            case 2:
                System.out.println("电脑出拳:石头");
                break;
            case 3:
                System.out.println("电脑出拳:布");
                break;
        }
        return num;
    }
}
